my %namesHash;
while ( chomp ( $name = <STDIN>)) {
	$namesHash{$name} += 1;
}
sort %namesHash;
foreach $key (sort keys %namesHash){
	print "$key + $namesHash{$key}\n";
}
